import request from '@/utils/request';
// import qs from 'qs';

// 套餐列表查询
export function query(params) {
  return request({
    url: process.env.VUE_APP_PRODUCT_API + '/oper/package/query',
    method: 'get',
    params
  });
}

// 套餐新增
export function addPackage(data) {
  return request({
    url: process.env.VUE_APP_PRODUCT_API + '/oper/package/create',
    method: 'POST',
    data
  });
}

// 通过ID查询套餐
export function queryPackage(params) {
  return request({
    url: process.env.VUE_APP_PRODUCT_API + '/oper/package/queryById/' + params.id,
    method: 'get'
  });
}

// 编辑套餐
export function editPackage(data) {
  return request({
    url: process.env.VUE_APP_PRODUCT_API + '/oper/package/update',
    method: 'POST',
    data
  });
}

// 查询套餐规则
export function queryRule(params) {
  return request({
    url: process.env.VUE_APP_PRODUCT_API + '/oper/packageRule/query',
    method: 'get',
    params
  });
}
// 新增规则
export function addPackageRule(data) {
  return request({
    url: process.env.VUE_APP_PRODUCT_API + '/oper/packageRule/create',
    method: 'POST',
    data
  });
}

// 通过ID查询套餐规则
export function queryRulePackage(params) {
  return request({
    url: process.env.VUE_APP_PRODUCT_API + '/oper/packageRule/queryById/' + params.id,
    method: 'get'
  });
}

// 编辑规则 /oper/packageRule/update
export function editPackageRule(data) {
  return request({
    url: process.env.VUE_APP_PRODUCT_API + '/oper/packageRule/update',
    method: 'POST',
    data
  });
}
